package com.rainbowred.system.domain;

import com.rainbowred.common.domain.BaseDomain;
import com.rainbowred.common.util.PojoUtil;
import com.rainbowred.common.util.aes.AESEncodingUtil;
import lombok.Data;

/**
 * 开发者配置表
 * @TableName edp_developer
 */
@Data
public class EdpDeveloper extends BaseDomain {

    public EdpDeveloper() {}

    public EdpDeveloper(String appid, String aeskey, String token) {
        this.appid = appid;
        this.aeskey = aeskey;
        this.token = token;
    }

    /**
     * 开发者ID
     */
    private String devId;

    /**
     * 开发者名称
     */
    private String name;

    /**
     * appid
     */
    private String appid;

    /**
     * aes密钥
     */
    private String aeskey;

    /**
     * 令牌
     */
    private String token;

    /**
     * dev赋值
     */
    public void initDevId() {
        this.devId = this.getId();
    }

    @Override
    public void initPojo() {
        super.initPojo();
        this.appid = AESEncodingUtil.getNonce(32).toUpperCase();
        this.aeskey = AESEncodingUtil.getNonce(43);
        this.token = AESEncodingUtil.getNonce(8);
    }
}
